'''
Created on 18.05.2010

@author: reinelt
'''

import parse_cl_input
import check_input_file
import check_disk_space
import crypt_file
import sys
import os

if __name__ == '__main__':
    #parse command line input:
    pcl = parse_cl_input.parse_cl_input()   
    #flush stdout for realtime poll into gui:
    sys.stdout.flush() 
    #check input file:
    filesize, zip = check_input_file.check_input_file(pcl.options.inputfile,pcl.options.verbose)
    sys.stdout.flush() 
    #check disk space and output location
    multipl = 0
    check_disk_space.check_disk_space(filesize,multipl,pcl.options.inputfile,pcl.options.verbose)
    sys.stdout.flush() 
    #(de)crypt file:
    crypt_file.crypt_file(pcl.key,pcl.encdec,pcl.options.cipher,pcl.options.inputfile,pcl.options.outputfile,pcl.options.wipe,pcl.options.verbose)
    if pcl.options.verbose:
        print "\nend of operation"
    sys.exit(1)
